package com.neuedu.elmserver.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.neuedu.elmserver.pojo.Business;
import com.neuedu.elmserver.pojo.Recipes;
import com.neuedu.elmserver.service.FoodService;
import com.neuedu.elmserver.service.RecipesService;
import com.neuedu.elmserver.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 减脂菜谱前端控制器
 * </p>
 *
 * @author wyh
 * @since 2024-11-20
 */
@CrossOrigin
@RestController
@RequestMapping("api/recipes")
/*
public class RecipesController {
    private final RecipesService recipesService;


    @Autowired
    public RecipesController(RecipesService recipesService) {

        this.recipesService = recipesService;
    }

    @GetMapping
    public ResponseEntity<ResultVO<List<Recipes>>> getRecipesList() {
        ResultVO<List<Recipes>> result = recipesService.getRecipesList();
        if (result.getCode() == 200) {
            return new ResponseEntity<>(result, HttpStatus.OK);
        }
        return new ResponseEntity<>(result, HttpStatus.NO_CONTENT);
    }
}*/
public class RecipesController {

    @Autowired
    private RecipesService recipesService;


    @GetMapping()
    public ResultVO queryRecipesList(){

        return  recipesService.queryRecipesList();
    }


}

